<?php
class profile_model extends CI_Model
{
	function __construct(){
        parent::__construct();
	}
		
	function get_info($mid)
	{
		$this->db->where('member_id',$mid);	
		$query = $this->db->get('member');
		return	$query->row();
	}

	function save($data, $id=0)
	{
		if(!empty($id))
		{
			$this->db->where('member_id', $id) ;
			return $this->db->update('member', $data) ;
		}
		else
		{
			return $this->db->insert('member', $data) ;
		}
		
	}
	function update_password($member_id)
	{
		$data['password'] = md5($this->input->post('newpass')) ;
		$this->db->where('member_id',$member_id);
		return $this->db->update('member',$data) ;
	}


}
?>
